<?php 

class layout
{
	protected $_baseHtml	= null;
	protected $_content		= null;
	protected $_error		= null;
	protected $_page		= null;
	protected $_title		= null;
	protected $_lang		= null;
	
	function __construct(){
		$this->_baseHtml = file_get_contents('./pages/html/page.html');
		$this->_content = $this->_title = $this->_error = "";
	}
	
	public function setLanguage($lang){
		$this->_lang = $lang;
	}
	
	public function setTitle($title){
		$this->_title = $title;
	}
	
	public function setContent($content){
		$this->_content = $content;
	}
	
	public function setError($error){
		$this->_error = $error;
	}
	
	public function getPage(){
		$page = str_replace ('[[content]]',$this->_content,$this->_baseHtml);
		$page = str_replace ('[[error]]',$this->_error,$page);
		$page = str_replace ('[[title]]',$this->_title,$page);
		$page = str_replace ('{lang}',$this->_lang,$page);
		return $page;
	}
	
}


?>